#-*- coding:utf-8 -*-
from odoo import api, fields, models, _

class AccountAnalyticLine(models.Model):
    _inherit = 'account.analytic.line'

    @api.onchange('project_id')
    def onchange_project_id(self):
        self.task_id = False
        result = {}
        result['domain'] = {'task_id': [('project_id', '=', self.project_id.id)]}
        return result